home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 01 / 3 / DISK0130.ZIP / TRANSLIT.MAN < prev    next >
Text File  |  1983-09-07  |  2KB  |  78 lines

  1. .im man.im
  2. .NM translit transliterate characters
  3. .SY translit [^]src [dest]
  4. .FU
  5. .ital translit
  6. maps its input, on a character by character basis, and writes the
  7. translated version to its output.
  8. In the simplest case, each character in the argument
  9. .ital src
  10. is translated to the corresponding character in the argument
  11. .ital dest;
  12. all other characters are copied as is.
  13. Both
  14. .ital src
  15. and
  16. .ital dest
  17. may contain substrings of the form
  18. .bold c1-c2
  19. as shorthand for all of the characters in the range
  20. .bold c1..c2.
  21. .bold c1
  22. and
  23. .bold c2
  24. must both be digits, or both be letters of the same case.
  25.  
  26. If
  27. .ital dest
  28. is absent, all characters represented by
  29. .ital src
  30. are deleted.
  31. Otherwise, if
  32. .ital dest
  33. is shorter than
  34. .ital src,
  35. all characters in
  36. .ital src
  37. that would map to or beyond the last character in
  38. .ital dest
  39. are mapped to the last character in
  40. .ital dest;
  41. moreover adjacent instances of such characters in the input are
  42. represented in the output by a single instance of the last character in
  43. .ital dest.
  44. Thus
  45. .Q1
  46. translit 0-9 9
  47. .Q2
  48. converts each string of digits to the single digit
  49. .ital 9.
  50.  
  51. Finally, if
  52. .ital src
  53. is preceded by a
  54. .ital ^,
  55. then
  56. .sf 6
  57. all but
  58. .sf 0
  59. the characters represented by
  60. .ital src
  61. are taken as the source string;
  62. i.e., they are all deleted if
  63. .ital dest
  64. is absent, or they are all collapsed if the last character in
  65. .ital dest
  66. is present.
  67. .EG
  68. To convert upper case to lower:
  69. .Q1
  70. translit A-Z a-z
  71. .Q2
  72. To discard punctuation and isolate words by spaces on each line:
  73. .Q1
  74. translit ^a-zA-Z\@n " "
  75. This is a simple-minded test, i.e., a test of translit.
  76. .ital "This is a simple minded test i e a test of translit"
  77. .Q2
  78.